
import 'cesium/Widgets/widgets.css';
import '../css/main.css';

import qw from '../data/biaozhiModel/qw.gltf'

import Cesium from 'cesium/Cesium';
//require('cesium/Widgets/wigets.css');

class cesiumV {
    constructor() {
        this.initCesium();
    }
    initCesium() {
        var viewer = new Cesium.Viewer('cesiumContainer');

        // Set the initial camera view to look at Manhattan
        var initialPosition = Cesium.Cartesian3.fromDegrees(120.3939, 28.038, 753);
        var initialOrientation = new Cesium.HeadingPitchRoll.fromDegrees(
            21.27879878293835,
            -21.34390550872461,
            0.0716951918898415
        );
        viewer.scene.camera.setView({
            destination: initialPosition,
            //   orientation: initialOrientation,
            endTransform: Cesium.Matrix4.IDENTITY,
        });
        //加载地形;
        // var terrainLayer = new Cesium.CesiumTerrainProvider({
        //     url: 'http://localhost:8081/terrain/', // 默认立体地表
        //     // 请求照明
        //     // requestVertexNormals: true,
        //     // 请求水波纹效果
        //     // requestWaterMask: true
        // });
        // viewer.terrainProvider = terrainLayer;
        // //加载白模
        // var tileset = new Cesium.Cesium3DTileset({ url: 'http://127.0.0.1:8081/wenzhouBuilding/tileset.json' });
        // viewer.scene.primitives.add(tileset);

        // //加载精模
        // var scene = viewer.scene;
        // //	scene.globe.show = false;
        // var gltf = viewer.entities.add({
        //     name: 'gltf',
        //     position: new Cesium.Cartesian3.fromDegrees(120.3939, 28.03385),
        //     model: {
        //         uri: qw,
        //     },
        // });
        // viewer.zoomTo(gltf);
    }
}
export default cesiumV;

